/*
 *  $Id: BlueFlame.cs 903 2009-11-29 00:31:16Z thenn.erannor $
 *  This file is a part of Ragima CCG.
 *  (C) 2008 Ragima development group.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Fire.Abilities {
    public class BlueFlame: AbilityCard<Creature> {
        public BlueFlame(): base("001_f_a_blue_flame") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Fire;
            Target = CreatureTarget.Enemy;
        }

        protected override void DoAction(TargetArgs<Creature> args) {
            Creature target = args.Target;
            BlueFlameAffect affect = target.GetAffect<BlueFlameAffect>();
            int value = 1;
            if (affect != null) {
                value += affect.Value;
                target.RemoveAffect(affect);
            }
            target.AddAffect(new BlueFlameAffect(value));
        }

        private class BlueFlameAffect: SpellAffect<BlueFlame> {
            public readonly int Value;

            public BlueFlameAffect(int value): base(true) {
                DefaultDescription = true;
                Value = value;
                Add(new Affects.Scorch(value));
            }

            public override string DescriptionText {
                get { return Description.GetText(Value); }
            }

            public override Affect Clone() {
                return new BlueFlameAffect(Value);
            }
        }
    }
}
